<?php
	
	if($_POST['act']=='op')
	{
		if(is_array($_POST['chk']))
		{
			$id=implode(",",$_POST['chk']);
			$sql="delete from ".RESERVE." where id in ($id)";
			$db->query($sql);
			msg("?m=product&s=product_reserve.php");
		}
	}
if($_GET['action'] == 'check'){
	$sql="update ".RESERVE." set status = 1 where id = '$_GET[id]' ";
	$db->query($sql);
	msg("?m=product&s=product_reserve.php");
}

if($_GET['action'] == 'del'){
	$sql="delete from ".RESERVE." where id = '$_GET[id]' ";
	$db->query($sql);
	msg("?m=product&s=product_reserve.php");
}

	$sql="select * from ".RESERVE." where 1  order by id desc";
	//====================
	include_once("../includes/page_utf_class.php");
	$page = new Page;
	$page->listRows=10;
	if (!$page->__get('totalRows')){
		$db->query($sql);
		$page->totalRows = $db->num_rows();
	}
	$sql .= "  limit ".$page->firstRow.",".$page->listRows;
	//=====================
	$db->query($sql);
	$de['list']=$db->getRows();
	$de['page'] = $page->prompt();

	$tpl->assign("de",$de);
	$tpl->assign("config",$config);
	$tpl->display("product_reserve.htm");
?>